package edu.njust.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Record {
    private Long id;
    private String student_id;
    private Long reservationItem_id;
    private String reservation_name;
    private Integer type;
    private Integer state;
    private Integer seat_num;


    public Record(String student_id, Long reservationItem_id, String reservation_name, Integer type, Integer state) {
        this.student_id = student_id;
        this.reservationItem_id = reservationItem_id;
        this.reservation_name = reservation_name;
        this.type = type;
        this.state = state;
    }

    public Record(String student_id, Long reservationItem_id, String reservation_name, Integer type, Integer state, Integer seat_num) {
        this.student_id = student_id;
        this.reservationItem_id = reservationItem_id;
        this.reservation_name = reservation_name;
        this.type = type;
        this.state = state;
        this.seat_num = seat_num;
    }

    public Integer cancel(){
        if(state == 1){
            state = 0;
            return 1;
        }
        return 0;
    }
}
